package com.hopu.exception;

import com.hopu.entity.Result;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

//全局异常处理,懒得搞其他的
@RestControllerAdvice
public class GlobalExceptionHandler {

    @ExceptionHandler(Exception.class)
    public Result GlobalExceptionHandler(Exception ex) {
        ex.printStackTrace();
        return Result.error("操作失败");
    }
}
